home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
FishMarket 1.0
/
FishMarket v1.0.iso
/
fishies
/
526-550
/
disk_539
/
pf
/
source
/
aw.h
< prev
next >
Wrap
Text File
|
1992-05-06
|
4KB
|
158 lines
/*---------------------------------------------------*
| Constants for "ask window" dimensions and gadgets |
*---------------------------------------------------*/
/**
| Special return values, and general constants
**/
#define CANCEL 0
#define QUIT -1
#define BLUE_PEN 0
#define WHITE_PEN 1
#define BLACK_PEN 2
#define RED_PEN 3
/**
| Window constants
**/
#define AW_LEFT 0
#define AW_TOP 0
#define AW_HEIGHT 85
#define AW_WIDTH 300
#define AW_IDCMP GADGETUP
#define AW_FLAGS1 WINDOWDEPTH | WINDOWDRAG
#define AW_FLAGS2 SMART_REFRESH | NOCAREREFRESH | ACTIVATE
#define AW_FLAGS (AW_FLAGS1 | AW_FLAGS2)
#define AW_TLEN 32
/**
| Gadget constants
**/
#define AW_YTITLE 25
#define AW_YCYCLE 50
#define AW_YCGAD 40
#define AW_XFORWARD 10
#define AW_XBACKWARD 266
#define AW_YNGAD 65
#define AW_XOK 27
#define AW_XQUIT 118
#define AW_XCAN 209
#define AW_WCGAD 24
#define AW_HCGAD 13
#define AW_WNGAD 64
#define AW_HNGAD 12
#define AW_NFLAGS GADGHCOMP
#define AW_NACT GADGIMMEDIATE | RELVERIFY
#define AW_CANCEL 1
#define AW_QUIT 2
#define AW_OK 3
#define AW_FORWARD 4
#define AW_BACKWARD 5
/**
| Gadget and window global variables
**/
static USHORT __chip backGdata[] = {
0xFFFF, 0xFF00, 0x8000, 0x0100, 0x83FF, 0xC100,
0x8600, 0x6100, 0x8C00, 0x3100, 0xBF00, 0x3100,
0x9E00, 0x3100, 0x8C00, 0x3100, 0x8000, 0x3100,
0x8600, 0x6100, 0x83FF, 0xC100, 0x8000, 0x0100,
0xFFFF, 0xFF00
};
static USHORT __chip forwGdata[] = {
0xFFFF, 0xFF00, 0x8000, 0x0100, 0x83FF, 0xC100,
0x8600, 0x6100, 0x8C00, 0x3100, 0x8C00, 0xFD00,
0x8C00, 0x7900, 0x8C00, 0x3100, 0x8C00, 0x0100,
0x8600, 0x6100, 0x83FF, 0xC100, 0x8000, 0x0100,
0xFFFF, 0xFF00
};
static struct Image backGimage = {
0, 0, AW_WCGAD, AW_HCGAD, 1,
(USHORT *) &backGdata, 0x01, 0x00, NULL
};
static struct Image forwGimage = {
0, 0, AW_WCGAD, AW_HCGAD, 1,
(USHORT *) &forwGdata, 0x01, 0x00, NULL
};
static struct Gadget backGadget = {
NULL, AW_XBACKWARD, AW_YCGAD, AW_WCGAD, AW_HCGAD,
GADGHCOMP | GADGIMAGE,
RELVERIFY,
BOOLGADGET,
(APTR) &backGimage, NULL,
NULL, NULL, NULL, AW_BACKWARD, NULL
};
static struct Gadget forwGadget = {
&backGadget, AW_XFORWARD, AW_YCGAD, AW_WCGAD, AW_HCGAD,
GADGHCOMP | GADGIMAGE,
RELVERIFY,
BOOLGADGET,
(APTR) &forwGimage, NULL,
NULL, NULL, NULL, AW_FORWARD, NULL
};
static SHORT NGbdata[] = {
0, 0,
AW_WNGAD-1, 0,
AW_WNGAD-1, AW_HNGAD-1,
0, AW_HNGAD-1,
0, 0
};
static struct Border NGborder = {
0, 0, RED_PEN, BLACK_PEN, JAM1, 5, NGbdata, NULL
};
static struct IntuiText canText = {
WHITE_PEN, BLACK_PEN, JAM2, 8, 2, NULL,
(UBYTE *) "CANCEL", NULL
};
static struct IntuiText quitText = {
WHITE_PEN, BLACK_PEN, JAM2, 8, 2, NULL,
(UBYTE *) " QUIT ", NULL
};
static struct IntuiText okText = {
WHITE_PEN, BLACK_PEN, JAM2, 8, 2, NULL,
(UBYTE *) " OK ", NULL
};
static struct Gadget askGad[] = {
{ &askGad[1],
AW_XCAN, AW_YNGAD, AW_WNGAD, AW_HNGAD,
AW_NFLAGS, AW_NACT, BOOLGADGET, (APTR) &NGborder,
NULL, &canText, 0, NULL, AW_CANCEL, NULL },
{ &askGad[2],
AW_XQUIT, AW_YNGAD, AW_WNGAD, AW_HNGAD,
AW_NFLAGS, AW_NACT, BOOLGADGET, (APTR) &NGborder,
NULL, &quitText, 0, NULL, AW_QUIT, NULL },
{ &forwGadget,
AW_XOK, AW_YNGAD, AW_WNGAD, AW_HNGAD,
AW_NFLAGS, AW_NACT, BOOLGADGET, (APTR) &NGborder,
NULL, &okText, 0, NULL, AW_OK, NULL },
};
static char title[AW_TLEN] = "";
static struct NewWindow NWind = {
AW_LEFT, AW_TOP, AW_WIDTH, AW_HEIGHT,
BLUE_PEN, WHITE_PEN, AW_IDCMP, AW_FLAGS,
askGad, NULL, (UBYTE *) title,
NULL, NULL,
AW_WIDTH, AW_HEIGHT, AW_WIDTH, AW_HEIGHT,
WBENCHSCREEN
};
static int realWidth, realHeight;